SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[usp_DeleteSurveyTheme]

	(
	@param_id INT

	)

AS
	/* SET NOCOUNT ON */
	
	DELETE FROM dbo.JOL_SurveyManagement_Respond WHERE item IN (SELECT id FROM dbo.JOL_SurveyManagement_Items WHERE survey=@param_id)
	
	DELETE FROM dbo.JOL_SurveyManagement_Items WHERE survey=@param_id
	
	DELETE FROM dbo.JOL_SurveyManagement_Theme WHERE id=@param_id
	
	
	
	RETURN
GO
